import { Injectable } from '@nestjs/common';
import { MongodbBaseService } from './mongodb-base.service';
import { Setting, SettingDocument } from '../schemas/setting.schema';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { CreateSettingDto, UpdateSettingDto } from '../dto/setting.dto';

@Injectable()
export class SettingService extends MongodbBaseService<
  SettingDocument,
  CreateSettingDto,
  UpdateSettingDto
> {
  constructor(@InjectModel(Setting.name) settingModal: Model<SettingDocument>) {
    super(settingModal);
  }
  async findFirst() {
    return this.model.findOne();
  }
}
